<template lang="html">
  <div class="main-page" id="store-page">
    <!-- 标题 -->
    <!-- <van-nav-bar class="main-header" :title="income_name" :left-arrow="true" :fixed="true" :z-index="11" @click-left="onClickLeft"/> -->
    <nav-bar :title="income_name" @goBack="onClickLeft"/>
    <!-- 主体内容 -->
    <div class="main-content has-main-tabbar has-header-space">
      <!-- <notice-bar @click="openMsg" title="如果您对您的订单有任何疑问，请联系客服 >>"></notice-bar> -->
      <div class="pay-container">
         <div class="pay-price">{{amount}}</div>
         <div style="color:#999999;font-size:16px;margin-top:10px;">{{title}}</div>
      </div>
      <div class="info-row">
        <van-cell v-if="title === '收入'" style="margin-bottom: 10px; display:block">
          <div slot="title">
            <span style="color:#999999;font-size:14px;margin-left:10px;">商品名称</span>
          </div>
          <span v-if="title === '收入'" style="color:#17273A;font-size:14px;margin-left:10px; display:block; text-align:left">{{product_name}}</span>
        </van-cell>
        <van-cell >
          <div slot="title">
            <span style="color:#999999;font-size:14px;margin-left:10px;">类型</span>
          </div>
          <span style="color:#17273A;font-size:14px;margin-left:10px;">{{type}}</span>
        </van-cell>
        <van-cell v-if="title === '提现'">
         <div slot="title">
           <span style="color:#999999;font-size:14px;margin-left:10px;">提现结果</span>
         </div>
         <span style="color:#17273A;font-size:14px;margin-left:10px;">{{cash_status}}-{{bank_name}}{{card_no ? '（' + card_no.substr(-4) + '）' : ''}}</span>
       </van-cell>
       <van-cell>
          <div slot="title">
            <span style="color:#999999;font-size:14px;margin-left:10px;">创建时间</span>
          </div>
          <span style="color:#17273A;font-size:14px;margin-left:10px;">{{create_at}}</span>
        </van-cell>
       <van-cell v-if="title === '提现'">
         <div slot="title">
           <span style="color:#999999;font-size:14px;margin-left:10px;">提现备注</span>
         </div>
         <span style="color:#17273A;font-size:14px;margin-left:10px;">{{cash_result}}</span>
       </van-cell>
         <van-cell v-if="title === '提现'">
          <div slot="title">
            <span style="color:#999999;font-size:14px;margin-left:10px;">流水单号</span>
          </div>
          <span style="color:#17273A;font-size:14px;margin-left:10px;">{{serial_no}}</span>
        </van-cell>
       </div>
    </div>
  </div>
</template>

<script>
// import NoticeBar from '@/components/global/notice-bar.vue'
import NavBar from '@/components/global/nav-bar.vue'

export default {
  components: { NavBar },
  data () {
    return {
      active: 1,
      title: '',
      type: '',
      order_no: '',
      product_name: '',
      create_at: '',
      serial_no: '',
      cash_type: '',
      amount: '',
      income_name: '',
      cash_status: '',
      cash_result: '',
      card_no: ''
    }
  },
  created () {
    console.log(this.$route)
    this.title = this.$route.query.title
    this.type = this.$route.query.type
    this.create_at = this.$route.query.create_at
    this.serial_no = this.$route.query.serial_no
    this.cash_type = this.$route.query.cash_type
    this.order_no = this.$route.query.order_no
    this.product_name = this.$route.query.product_name
    this.amount = this.$route.query.amount
    this.cash_status = this.$route.query.cash_status
    this.cash_result = this.$route.query.cash_result
    this.card_no = this.$route.query.card_no ? this.$route.query.card_no : ''
    this.bank_name = this.$route.query.bank_name ? this.$route.query.bank_name : ''
    if (this.title === '收入') {
      this.income_name = '收入详情'
      window.document.title = '收入详情'
    } else {
      this.income_name = '提现详情'
      window.document.title = '提现详情'
    }
  },
  methods: {
    onClickLeft () {
      this.$router.go(-1)
    },
    openMsg () {
      console.log(123)
    }
  }
}
</script>
<style lang="scss" scoped>
.pay-container{background-color:#fff;text-align:center;padding:25px 0; margin-bottom: 10px}
.pay-price{color:#e91f3f;font-size:30px;}
.van-cell__value {
  min-width: 70%
}
// .info-row{background-color: #ffffff;}
</style>
